package com.training.action.xixiaoming;

import java.util.List;

import com.training.pojo.chengshu.MotorRoom;
import com.training.pojo.chengshu.UDept;
import com.training.pojo.chengshu.UUser;
import com.training.service.xixiaoming.deptService;
import com.training.service.xixiaoming.empService;
import com.training.service.xixiaoming.motorService;

public class searchMotorAction {
	private String uid;
	private String deptid;
	private String deptname;
	private String address;
	private motorService motorser;
	List<MotorRoom> listmotor;
	
	private deptService deptser;
	private empService empser;
	
	private List<UDept> deptlist;
	private List<UUser> emplist;
	
	public String execute(){
		System.out.println("searchMotorAction");
		deptlist=deptser.getAllDept();
		emplist=empser.getAllEmp();
		Integer userid=0;
		Integer deptId=0;
		if(uid!=null && (!uid.equals(""))){
			userid=Integer.parseInt(uid);
		}
		if(deptid!=null && (!deptid.equals(""))){
			deptId=Integer.parseInt(deptid);
		}
		listmotor=motorser.serachMotor(userid,deptId,deptname,address);
		return "success";
	}

	public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	public String getDeptid() {
		return deptid;
	}

	public void setDeptid(String deptid) {
		this.deptid = deptid;
	}

	public String getDeptname() {
		return deptname;
	}

	public void setDeptname(String deptname) {
		this.deptname = deptname;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public motorService getMotorser() {
		return motorser;
	}

	public void setMotorser(motorService motorser) {
		this.motorser = motorser;
	}

	public List<MotorRoom> getListmotor() {
		return listmotor;
	}

	public void setListmotor(List<MotorRoom> listmotor) {
		this.listmotor = listmotor;
	}

	public deptService getDeptser() {
		return deptser;
	}

	public void setDeptser(deptService deptser) {
		this.deptser = deptser;
	}

	public empService getEmpser() {
		return empser;
	}

	public void setEmpser(empService empser) {
		this.empser = empser;
	}

	public List<UDept> getDeptlist() {
		return deptlist;
	}

	public void setDeptlist(List<UDept> deptlist) {
		this.deptlist = deptlist;
	}

	public List<UUser> getEmplist() {
		return emplist;
	}

	public void setEmplist(List<UUser> emplist) {
		this.emplist = emplist;
	}

}
